package cn.iocoder.yudao.module.dbit.dal.mysql.jobinfo;



import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.dbit.dal.dataobject.jobinfo.JobInfoDO;
import cn.iocoder.yudao.module.dbit.dal.dataobject.jobinfo.StudentCheckJobInfoDO;
import cn.iocoder.yudao.module.dbit.enums.jobinfo.JobInfoEunums;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.dbit.controller.admin.jobinfo.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 企业职位信息 Mapper
 *
 * @author DaBen
 */
@Mapper
public interface StudentCheckJobInfoMapper extends BaseMapperX<StudentCheckJobInfoDO> {

    default PageResult<StudentCheckJobInfoDO> selectPage(JobInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StudentCheckJobInfoDO>()
                .likeIfPresent(StudentCheckJobInfoDO::getJobName, reqVO.getJobName())
                .eqIfPresent(StudentCheckJobInfoDO::getJobType, reqVO.getJobType())
                .eqIfPresent(StudentCheckJobInfoDO::getSalaryRangeFrom, reqVO.getSalaryRangeFrom())
                .eqIfPresent(StudentCheckJobInfoDO::getSalaryRangeTo, reqVO.getSalaryRangeTo())
                .likeIfPresent(StudentCheckJobInfoDO::getJobCity, reqVO.getJobCity())
                .eqIfPresent(StudentCheckJobInfoDO::getJobRequireEdu, reqVO.getJobRequireEdu())
                .eq(StudentCheckJobInfoDO::getJobStatus, JobInfoEunums.JOB_STATUS_PUBLIC)
                .orderByDesc(StudentCheckJobInfoDO::getJobId));
    }


    IPage<StudentCheckJobInfoDO> selectAllJob(IPage<StudentCheckJobInfoDO> page,@Param("reqVO")JobInfoPageReqVO reqVO);

    StudentCheckJobInfoDO selectByJobId(Integer id);

    List<JobInfoDO> randJobInfo();

    List<JobInfoDO> recommendJobInfo(@Param("jobTitleIds") List<String> jobTitleIds);

    List<JobInfoDO> latestJobInfo();
}